package org.flyer.toolFrame.component;

import org.flyer.toolFrame.util.FileUtil;
import org.flyer.toolFrame.util.MenuUtil;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

@Component
public class FileTool {
    public void queryFileLocationByCondition(){
        Scanner scanner=new Scanner(System.in);
        System.out.println("请输入所要检索的地址");
        String location = scanner.next();
        System.out.println("请输入所要检索的文件类型,多个类型之间用','隔开");
        String suffixs = scanner.next();
        List<String> filesLocation=new ArrayList<>();
        System.out.println("开始检索...");
        List<String> strings = FileUtil.queryFiles(location, suffixs, filesLocation);
        for (String str:strings) {
            System.out.println(str);
        }
    }
}
